package cn.tedu.mycoolshark.controller;

import cn.tedu.mycoolshark.entity.Product;
import cn.tedu.mycoolshark.map.ProductMapper;
import cn.tedu.mycoolshark.map.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class ProductController {
    @Autowired
    ProductMapper mapper;
  @RequestMapping("/product/insert")
    public void insert(@RequestBody Product product){
       mapper.insert(product);
  }
  @RequestMapping("/product/select/index")
    public List<Product> selectIndex(){
      return mapper.selectIndex();
  }

}
